#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include "Service.h"
#include "Private.h"
#include <unistd.h>
#include <fcntl.h>

/// <summary>
/// TODO
/// </summary>
int OpenConsole(int mode)
{
	int f = 0;
	int fd = -1;
	for (f = 0; f < 5; f++) {
		if ((fd = open("/dev/console", mode)) >= 0)
			break;
		usleep(10000);
	}
	return fd;
}

/// <summary>
/// TODO
/// </summary>
int CloseConsole(int handle)
{
	if (handle < 0)
		return -1;
	return 0;
}
